<template>
  <el-row class="tac">
    <Sidebar></Sidebar>
    <BookList
      :tag = 'tag'
      :bookName="bookName"
      :from="from"
    ></BookList>
  </el-row>
</template>

<script>
import Sidebar from '../../components/Home/Announcement/Sidebar'
import BookList from '../../components/Search/BookList'
export default {
  name: 'Home',
  components: {
    BookList,
    Sidebar
  },
  data () {
    return {
      ID: '',
      tag: this.$route.query.class,
      bookName: this.$route.query.title,
      from: this.$route.query.from
    }
  },
  // 后台交互，class不为空是类别搜索，否则是名字搜索（暂不支持两者一起）
  created () {
    this.tag = this.$route.query.class
    this.bookName = this.$route.query.title
    this.from = this.$route.query.from
  }
  // watch: {
  //   from () {
  //     location.reload()
  //   },
  //   tag () {
  //     location.reload()
  //   },
  //   bookName () {
  //     location.reload()
  //   }
  // }
}
</script>

<style scoped>

</style>
